<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <div id="app">
        <demo></demo>
        <async-comp></async-comp>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    Vue.component('demo', {
        template: `
        <h1>同步组件</h1>
        `
    })

    // 异步组件
    Vue.component('async-comp', function(resolve, reeject) {
        setTimeout(() => {
            resolve({
                template: "<h1>异步组件</h1>"
            })
        }, 2000)
    })
    let vm = new Vue({
        el: "#app",
    });
</script>

</html>